#!/usr/bin/env python
# -*-coding:UTF-8 -*-
'''
@Project ：19-xpath站长素材.py
@File：48.selenium模拟登录qqzone.py
@Author ：文非
@Date：2021/3/1620:45
@Require：
'''
from selenium import webdriver

from time import sleep

# 实例化一个浏览器对象
browser = webdriver.Chrome(executable_path="./chromedriver.exe")
# 指定url
url = "https://qzone.qq.com/"
# 发送请求
browser.get(url)
# 获取登录需要的三个标签
browser.switch_to.frame("login_frame")
a_login_tag = browser.find_element_by_id("switcher_plogin")
a_login_tag.click()
login_id = browser.find_element_by_id("u")
login_id.send_keys("2565088230")
# sleep(1)
login_pwd = browser.find_element_by_id("p")
login_pwd.send_keys("zwwlx10131995.")
# sleep(1)
login_btn = browser.find_element_by_id("login_button")
# sleep(1)
login_btn.click()
# 点击登录


# browser.quit()